package com.app.repository.impl;

import com.app.model.main.Notify;
import com.app.repository.interfaces.NotifyMapper;
import com.app.support.dao.MybatisDao;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * Created by Lichaojie on 2017/3/12. It's a beautiful day.
 */
@Repository
public class NotifyMapperImpl implements NotifyMapper {

    @Autowired
    private MybatisDao mybatisDao;

    @Override
    public int deleteByPrimaryKey(Long id){
        return mybatisDao.delete("com.app.dao.main.NotifyMapper",".deleteByPrimaryKey",id);
    }

    @Override
    public int insert(Notify record){
        return mybatisDao.insert("com.app.dao.main.NotifyMapper", ".insert", record);
    }

    @Override
    public int insertSelective(Notify record){
        return mybatisDao.insert("com.app.dao.main.NotifyMapper",".insertSelective",record);
    }

    @Override
    public Notify selectByPrimaryKey(Long id){
        return mybatisDao.get("com.app.dao.main.NotifyMapper", ".selectByPrimaryKey", id);
    }

    @Override
    public List<Notify> selectByReceiverId(Long receiverId){
        return mybatisDao.getList("com.app.dao.main.NotifyMapper",".selectByReceiverId",receiverId);
    }

    @Override
    public int updateByPrimaryKeySelective(Notify record){
        return mybatisDao.update("com.app.dao.main.NotifyMapper",".updateByPrimaryKeySelective",record);
    }

    @Override
    public int updateByPrimaryKey(Notify record){
        return mybatisDao.update("com.app.dao.main.NotifyMapper",".updateByPrimaryKey",record);
    }

    @Override
    public long getMaxId(){
        return mybatisDao.count("com.app.dao.main.NotifyMapper",".getMaxId",null);
    }
}
